/**
 * Copyright (c) 2013 onionframework.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package org.onionframework.persistence.dao;

import java.util.Collection;
import java.util.List;

import org.onionframework.persistence.query.OnionQuery;

/**
 * @author allan
 *
 */
public interface CommonDao {

	public abstract void save(Object object);

	/**
	 * 批量保存
	 * @param objects 要保存的对象集合
	 */
	public abstract void saveAll(Collection<?> objects);

	public abstract void merge(Object object);

	public abstract void evict(Object object);

	public abstract void remove(Object o);

	public abstract void flush();

	public abstract void refresh(Object o);

	public abstract <E> List<E> findList(OnionQuery onionQuery);

	public abstract <T> T findUnique(OnionQuery onionQuery);

	public abstract Long count(OnionQuery query);

}